<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>com.drake.net.utils</title>
<link href="../../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../";</script><script type="text/javascript" src="../../scripts/sourceset_dependencies.js" async="async"></script><link href="../../styles/style.css" rel="Stylesheet"><link href="../../styles/logo-styles.css" rel="Stylesheet"><link href="../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../styles/main.css" rel="Stylesheet"><script type="text/javascript" src="../../scripts/clipboard.js" async="async"></script><script type="text/javascript" src="../../scripts/navigation-loader.js" async="async"></script><script type="text/javascript" src="../../scripts/platform-content-handler.js" async="async"></script><script type="text/javascript" src="../../scripts/main.js" async="async"></script>  </head>
  <body>
    <div id="container">
      <div id="leftColumn"><a href="../../index.html">
          <div id="logo"></div>
        </a>
        <div id="paneSearch"></div>
        <div id="sideMenu"></div>
      </div>
      <div id="main">
        <div id="leftToggler"><span class="icon-toggler"></span></div>
<script type="text/javascript" src="../../scripts/main.js"></script>        <div class="main-content" id="content" pageIds="Net::com.drake.net.utils////PointingToDeclaration//1281733757">
          <div class="navigation-wrapper" id="navigation-wrapper">
            <div class="breadcrumbs"><a href="../../index.html">Net</a>/<a href="index.html">com.drake.net.utils</a></div>
            <div class="pull-right d-flex">
              <div id="searchBar"></div>
            </div>
          </div>
          <div class="cover ">
            <h1 class="cover"><span>Package com.</span><wbr></wbr><span>drake.</span><wbr></wbr><span>net.</span><wbr></wbr><span>utils</span></h1>
          </div>
          <div class="tabbedcontent">
            <div class="tabs-section" tabs-section="tabs-section"><button class="section-tab" data-active="" data-togglable="Types">Types</button><button class="section-tab" data-togglable="Functions">Functions</button><button class="section-tab" data-togglable="Properties">Properties</button></div>
            <div class="tabs-section-body">
              <h2 class="">Types</h2>
              <div class="table" data-togglable="Types"><a data-name="-1940999869%2FClasslikes%2F1281733757" anchor-label="Https" id="-1940999869%2FClasslikes%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="-https/index.html">Https</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1940999869%2FClasslikes%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">object <a href="-https/index.html">Https</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
</div>
</div>
                    </div>
                  </div>
                </div>
              </div>
              <h2 class="">Functions</h2>
              <div class="table" data-togglable="Functions"><a data-name="-1178359299%2FFunctions%2F1281733757" anchor-label="debounce" id="-1178359299%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="debounce.html">debounce</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1178359299%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/android/widget/EditText.html">EditText</a>.<a href="debounce.html">debounce</a>(timeoutMillis: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html">Long</a> = 800): <span data-unresolved-link="kotlinx.coroutines.flow/Flow///PointingToDeclaration/">Flow</span>&lt;<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>&gt;<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-1178359299%2FFunctions%2F1281733757" anchor-label="debounce" id="-1178359299%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-1178359299%2FFunctions%2F1281733757" anchor-label="debounce" id="-1178359299%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>为EditText的输入框文本变化启用节流阀, 即超过指定时间后(默认800毫秒)的输入框文本变化事件<a href="https://developer.android.com/reference/kotlin/android/text/TextWatcher.html#ontextchanged">TextWatcher.onTextChanged</a>会被下游收集到</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-1236413140%2FFunctions%2F1281733757" anchor-label="fastest" id="-1236413140%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="fastest.html">fastest</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1236413140%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace"><div class="block"><div class="block">@<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-name/index.html">JvmName</a>(<span>name = <span class="breakable-word">fastestTransform</span></span><wbr></wbr>)</div></div>suspend fun &lt;<a href="fastest.html">T</a>, <a href="fastest.html">R</a>&gt; <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.<a href="fastest.html">fastest</a>(listDeferred: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a>&lt;<a href="../com.drake.net.transform/-deferred-transform/index.html">DeferredTransform</a>&lt;<a href="fastest.html">T</a>, <a href="fastest.html">R</a>&gt;&gt;?, group: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>? = null): <a href="fastest.html">R</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1371658153%2FFunctions%2F1281733757" anchor-label="fastest" id="1371658153%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1371658153%2FFunctions%2F1281733757" anchor-label="fastest" id="1371658153%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>该函数将选择<a href="fastest.html">listDeferred</a>中的Deferred执行<span data-unresolved-link="kotlinx.coroutines/Deferred/await/#/PointingToDeclaration/">Deferred.await</span>, 然后将返回最快的结果 执行过程中的异常将被忽略, 如果全部抛出异常则将抛出最后一个Deferred的异常</div></div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">suspend fun &lt;<a href="fastest.html">T</a>&gt; <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.<a href="fastest.html">fastest</a>(listDeferred: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a>&lt;<span data-unresolved-link="kotlinx.coroutines/Deferred///PointingToDeclaration/">Deferred</span>&lt;<a href="fastest.html">T</a>&gt;&gt;, group: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html">Any</a>? = null): <a href="fastest.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="38719657%2FFunctions%2F1281733757" anchor-label="fastest" id="38719657%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="38719657%2FFunctions%2F1281733757" anchor-label="fastest" id="38719657%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>该函数将选择<a href="fastest.html">listDeferred</a>中的Deferred执行<span data-unresolved-link="kotlinx.coroutines/Deferred/await/#/PointingToDeclaration/">Deferred.await</span>, 然后将返回最快的结果 执行过程中的异常将被忽略, 如果全部抛出异常则将抛出最后一个Deferred的异常</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="1736690299%2FFunctions%2F1281733757" anchor-label="isValid" id="1736690299%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="is-valid.html">isValid</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1736690299%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">inline fun <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>?.<a href="is-valid.html">isValid</a>(block: (<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>) -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>)<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
</div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="1355371836%2FFunctions%2F1281733757" anchor-label="lazyField" id="1355371836%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="lazy-field.html">lazyField</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1355371836%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun &lt;<a href="lazy-field.html">T</a>, <a href="lazy-field.html">V</a>&gt; <a href="lazy-field.html">T</a>.<a href="lazy-field.html">lazyField</a>(block: <a href="lazy-field.html">T</a>.(<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-property/index.html">KProperty</a>&lt;*&gt;) -&gt; <a href="lazy-field.html">V</a>): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.properties/-read-write-property/index.html">ReadWriteProperty</a>&lt;<a href="lazy-field.html">T</a>, <a href="lazy-field.html">V</a>&gt;<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1355371836%2FFunctions%2F1281733757" anchor-label="lazyField" id="1355371836%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1355371836%2FFunctions%2F1281733757" anchor-label="lazyField" id="1355371836%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>延迟初始化 线程安全 等效于<a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/index.html">lazy</a>, 但是可以获取委托字段属性</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-449393189%2FFunctions%2F1281733757" anchor-label="listen" id="-449393189%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="listen.html">listen</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-449393189%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">inline fun &lt;<a href="listen.html">T</a>&gt; <span data-unresolved-link="kotlinx.coroutines.flow/Flow///PointingToDeclaration/">Flow</span>&lt;<a href="listen.html">T</a>&gt;.<a href="listen.html">listen</a>(owner: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>? = null, event: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_DESTROY, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, crossinline action: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.(<a href="listen.html">T</a>) -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-android-scope/index.html">AndroidScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-449393189%2FFunctions%2F1281733757" anchor-label="listen" id="-449393189%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-449393189%2FFunctions%2F1281733757" anchor-label="listen" id="-449393189%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>收集Flow结果并过滤重复结果</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="2070769577%2FFunctions%2F1281733757" anchor-label="md5" id="2070769577%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="md5.html">md5</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="2070769577%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/java/io/File.html">File</a>.<a href="md5.html">md5</a>(): <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>?<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="2070769577%2FFunctions%2F1281733757" anchor-label="md5" id="2070769577%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="2070769577%2FFunctions%2F1281733757" anchor-label="md5" id="2070769577%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>返回文件的MD5值</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="1720587881%2FFunctions%2F1281733757" anchor-label="mediaType" id="1720587881%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="media-type.html">mediaType</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1720587881%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/java/io/File.html">File</a>.<a href="media-type.html">mediaType</a>(): <span data-unresolved-link="okhttp3/MediaType///PointingToDeclaration/">MediaType</span>?<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1720587881%2FFunctions%2F1281733757" anchor-label="mediaType" id="1720587881%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1720587881%2FFunctions%2F1281733757" anchor-label="mediaType" id="1720587881%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>返回文件的MediaType值, 如果不存在返回null</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="442524859%2FFunctions%2F1281733757" anchor-label="runMain" id="442524859%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="run-main.html">runMain</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="442524859%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="run-main.html">runMain</a>(block: () -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>)<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="442524859%2FFunctions%2F1281733757" anchor-label="runMain" id="442524859%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="442524859%2FFunctions%2F1281733757" anchor-label="runMain" id="442524859%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>在主线程运行</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="510091183%2FFunctions%2F1281733757" anchor-label="scope" id="510091183%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="scope.html">scope</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="510091183%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="scope.html">scope</a>(dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-android-scope/index.html">AndroidScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-965628061%2FFunctions%2F1281733757" anchor-label="scope" id="-965628061%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-965628061%2FFunctions%2F1281733757" anchor-label="scope" id="-965628061%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>异步作用域该作用域生命周期跟随整个应用, 注意内存泄漏</div></div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <span data-unresolved-link="com.drake.brv/PageRefreshLayout///PointingToDeclaration/">PageRefreshLayout</span>.<a href="scope.html">scope</a>(dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-page-coroutine-scope/index.html">PageCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="188170921%2FFunctions%2F1281733757" anchor-label="scope" id="188170921%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="188170921%2FFunctions%2F1281733757" anchor-label="scope" id="188170921%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>PageRefreshLayout的异步作用域<ol><li><p class="paragraph">下拉刷新自动结束</p></li><li><p class="paragraph">上拉加载自动结束</p></li><li><p class="paragraph">捕获异常</p></li><li><p class="paragraph">打印异常日志</p></li><li><p class="paragraph">吐司部分异常<a href="../com.drake.net/-net-config/on-state-error.html">com.drake.net.NetConfig.onStateError</a></p></li><li><p class="paragraph">判断添加还是覆盖数据</p></li><li><p class="paragraph">自动显示缺省页</p></li></ol>布局被销毁或者界面关闭作用域被取消</div></div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <span data-unresolved-link="com.drake.statelayout/StateLayout///PointingToDeclaration/">StateLayout</span>.<a href="scope.html">scope</a>(dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1166233667%2FFunctions%2F1281733757" anchor-label="scope" id="1166233667%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1166233667%2FFunctions%2F1281733757" anchor-label="scope" id="1166233667%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>自动处理缺省页的异步作用域 作用域开始执行时显示加载中缺省页 作用域正常结束时显示成功缺省页 作用域抛出异常时显示错误缺省页 并且自动吐司错误信息, 可配置 <a href="../com.drake.net/-net-config/on-state-error.html">com.drake.net.NetConfig.onStateError</a> 自动打印异常日志</div></div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">inline fun &lt;<a href="scope.html">T</a>&gt; <span data-unresolved-link="kotlinx.coroutines.flow/Flow///PointingToDeclaration/">Flow</span>&lt;<a href="scope.html">T</a>&gt;.<a href="scope.html">scope</a>(owner: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>? = null, event: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_DESTROY, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, crossinline action: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.(<a href="scope.html">T</a>) -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-android-scope/index.html">AndroidScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1032978820%2FFunctions%2F1281733757" anchor-label="scope" id="1032978820%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1032978820%2FFunctions%2F1281733757" anchor-label="scope" id="1032978820%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>Flow直接创建作用域</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="494429831%2FFunctions%2F1281733757" anchor-label="scopeDialog" id="494429831%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="scope-dialog.html">scopeDialog</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="494429831%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>.<a href="scope-dialog.html">scopeDialog</a>(dialog: <a href="https://developer.android.com/reference/kotlin/android/app/Dialog.html">Dialog</a>? = null, cancelable: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a> = true, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
</div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/FragmentActivity.html">FragmentActivity</a>.<a href="scope-dialog.html">scopeDialog</a>(dialog: <a href="https://developer.android.com/reference/kotlin/android/app/Dialog.html">Dialog</a>? = null, cancelable: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html">Boolean</a> = true, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-769711486%2FFunctions%2F1281733757" anchor-label="scopeDialog" id="-769711486%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-769711486%2FFunctions%2F1281733757" anchor-label="scopeDialog" id="-769711486%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>作用域开始时自动显示加载对话框, 结束时自动关闭加载对话框 可以设置全局对话框 <a href="../com.drake.net/-net-config/dialog-factory.html">com.drake.net.NetConfig.dialogFactory</a></div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-1279310286%2FFunctions%2F1281733757" anchor-label="scopeLife" id="-1279310286%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="scope-life.html">scopeLife</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1279310286%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>.<a href="scope-life.html">scopeLife</a>(lifeEvent: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_STOP, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-android-scope/index.html">AndroidScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>.<a href="scope-life.html">scopeLife</a>(lifeEvent: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_DESTROY, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-android-scope/index.html">AndroidScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
</div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="1204430410%2FFunctions%2F1281733757" anchor-label="scopeNet" id="1204430410%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="scope-net.html">scopeNet</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1204430410%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="scope-net.html">scopeNet</a>(dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1204430410%2FFunctions%2F1281733757" anchor-label="scopeNet" id="1204430410%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1204430410%2FFunctions%2F1281733757" anchor-label="scopeNet" id="1204430410%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>该函数比<a href="scope.html">scope</a>多了以下功能<ul><li><p class="paragraph">在作用域内抛出异常时会被回调的NetConfig.onError函数中</p></li><li><p class="paragraph">自动显示错误信息吐司, 可以通过指定NetConfig.onError来取消或者增加自己的处理</p></li></ul>该作用域生命周期跟随整个应用, 注意内存泄漏</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="1477772568%2FFunctions%2F1281733757" anchor-label="scopeNetLife" id="1477772568%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="scope-net-life.html">scopeNetLife</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="1477772568%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.html">Fragment</a>.<a href="scope-net-life.html">scopeNetLife</a>(lifeEvent: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_STOP, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-276277064%2FFunctions%2F1281733757" anchor-label="scopeNetLife" id="-276277064%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-276277064%2FFunctions%2F1281733757" anchor-label="scopeNetLife" id="-276277064%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>和上述函数功能相同, 只是接受者为FragmentFragment应当在<a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.ON_STOP.html">Lifecycle.Event.ON_STOP</a>时就取消作用域, 避免<a href="https://developer.android.com/reference/kotlin/androidx/fragment/app/Fragment.html#ondestroyview">Fragment.onDestroyView</a>导致引用空视图</div></div>
<div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/LifecycleOwner.html">LifecycleOwner</a>.<a href="scope-net-life.html">scopeNetLife</a>(lifeEvent: <a href="https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle.Event.html">Lifecycle.Event</a> = Lifecycle.Event.ON_DESTROY, dispatcher: <span data-unresolved-link="kotlinx.coroutines/CoroutineDispatcher///PointingToDeclaration/">CoroutineDispatcher</span> = Dispatchers.Main, block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html">Unit</a>): <a href="../com.drake.net.scope/-net-coroutine-scope/index.html">NetCoroutineScope</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="1327197676%2FFunctions%2F1281733757" anchor-label="scopeNetLife" id="1327197676%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="1327197676%2FFunctions%2F1281733757" anchor-label="scopeNetLife" id="1327197676%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>该函数比scopeNet多了自动取消作用域功能该作用域生命周期跟随LifecycleOwner.</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="482397297%2FFunctions%2F1281733757" anchor-label="toRequestBody" id="482397297%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="to-request-body.html">toRequestBody</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="482397297%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">fun <a href="https://developer.android.com/reference/kotlin/java/io/File.html">File</a>.<a href="to-request-body.html">toRequestBody</a>(contentType: <span data-unresolved-link="okhttp3/MediaType///PointingToDeclaration/">MediaType</span>? = null): <span data-unresolved-link="okhttp3/RequestBody///PointingToDeclaration/">RequestBody</span><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="482397297%2FFunctions%2F1281733757" anchor-label="toRequestBody" id="482397297%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="482397297%2FFunctions%2F1281733757" anchor-label="toRequestBody" id="482397297%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>创建File的RequestBody</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-809335799%2FFunctions%2F1281733757" anchor-label="withDefault" id="-809335799%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="with-default.html">withDefault</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-809335799%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">suspend fun &lt;<a href="with-default.html">T</a>&gt; <a href="with-default.html">withDefault</a>(block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="with-default.html">T</a>): <a href="with-default.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-809335799%2FFunctions%2F1281733757" anchor-label="withDefault" id="-809335799%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-809335799%2FFunctions%2F1281733757" anchor-label="withDefault" id="-809335799%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>切换到默认调度器</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-757903362%2FFunctions%2F1281733757" anchor-label="withIO" id="-757903362%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="with-i-o.html">withIO</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-757903362%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">suspend fun &lt;<a href="with-i-o.html">T</a>&gt; <a href="with-i-o.html">withIO</a>(block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="with-i-o.html">T</a>): <a href="with-i-o.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-757903362%2FFunctions%2F1281733757" anchor-label="withIO" id="-757903362%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-757903362%2FFunctions%2F1281733757" anchor-label="withIO" id="-757903362%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>切换到IO程调度器</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="-1290130575%2FFunctions%2F1281733757" anchor-label="withMain" id="-1290130575%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="with-main.html">withMain</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-1290130575%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">suspend fun &lt;<a href="with-main.html">T</a>&gt; <a href="with-main.html">withMain</a>(block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="with-main.html">T</a>): <a href="with-main.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="-1290130575%2FFunctions%2F1281733757" anchor-label="withMain" id="-1290130575%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="-1290130575%2FFunctions%2F1281733757" anchor-label="withMain" id="-1290130575%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>切换到主线程调度器</div></div>
</div>
                    </div>
                  </div>
                </div>
<a data-name="407844089%2FFunctions%2F1281733757" anchor-label="withUnconfined" id="407844089%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="with-unconfined.html">withUnconfined</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="407844089%2FFunctions%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title"><div class="divergent-group" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release"><div class="with-platform-tags"><span class="pull-right"></span></div>

  <div>
    <div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><div class="symbol monospace">suspend fun &lt;<a href="with-unconfined.html">T</a>&gt; <a href="with-unconfined.html">withUnconfined</a>(block: suspend <span data-unresolved-link="kotlinx.coroutines/CoroutineScope///PointingToDeclaration/">CoroutineScope</span>.() -&gt; <a href="with-unconfined.html">T</a>): <a href="with-unconfined.html">T</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
  </div>
<a data-name="407844089%2FFunctions%2F1281733757" anchor-label="withUnconfined" id="407844089%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="brief "><a data-name="407844089%2FFunctions%2F1281733757" anchor-label="withUnconfined" id="407844089%2FFunctions%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>切换到没有限制的调度器</div></div>
</div>
                    </div>
                  </div>
                </div>
              </div>
              <h2 class="">Properties</h2>
              <div class="table" data-togglable="Properties"><a data-name="-760921698%2FProperties%2F1281733757" anchor-label="isValid" id="-760921698%2FProperties%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a>
                <div class="table-row" data-filterable-current=":net:dokkaHtml/release" data-filterable-set=":net:dokkaHtml/release">
                  <div class="main-subrow keyValue ">
                    <div class=""><span class="inline-flex"><a href="is-valid.html">isValid</a><span class="anchor-wrapper"><span class="anchor-icon" pointing-to="-760921698%2FProperties%2F1281733757"></span>
                          <div class="copy-popup-wrapper "><span class="copy-popup-icon"></span><span>Link copied to clipboard</span></div>
                        </span></span></div>
                    <div>
                      <div class="title">
                        <div class="platform-hinted " data-platform-hinted="data-platform-hinted" data-togglable="Properties"><div class="content sourceset-depenent-content" data-active="" data-togglable=":net:dokkaHtml/release"><a data-name="-760921698%2FProperties%2F1281733757" anchor-label="isValid" id="-760921698%2FProperties%2F1281733757" data-filterable-set=":net:dokkaHtml/release"></a><div class="symbol monospace">val <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>?.<a href="is-valid.html">isValid</a>: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a>?<span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="footer"><span class="go-to-top-icon"><a href="#content"></a></span><span>© 2021 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
      </div>
    </div>
  </body>
</html>

